import React, {Component} from "react";
import {connect} from 'react-redux';
import Counter from "../components/counter";
import {increment, decrement, incrementAsync} from "../redux/actions";

/**
 * 容器组件
 *
 export default connect(
    state => ({count: state}),
    dispatch=> {return {increment:(number) => dispatch(increment(number)), decrement:(number) => dispatch(decrement(number))}}
 )(Counter)
 */
export default connect(
    state => ({count: state.count}),
    {increment, decrement, incrementAsync}
)(Counter)